home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / marxmenu.arc / LOGIN.MNU < prev    next >
Text File  |  1991-03-27  |  13KB  |  541 lines

  1. Comment
  2. ========================================================
  3.  
  4. Copyright 1990 by Marc Perkel * All right reserved.
  5.  
  6. Requires MarxMenu version 2.14 or later to run.
  7.  
  8. MarxMenu now allows you to login to a Novell network without using
  9. Novell's login program or messing with nasty login scripts. You can
  10. be in MarxMenu all the way in.
  11.  
  12. Logging into Novell is tricky. Especially if you are using boot roms
  13. on your network cards. Through much trial and error, I have found
  14. some solid tricks that make life easier.
  15.  
  16. You should have the following two BATCH files in your LOGIN
  17. directory as follows:
  18.  
  19. LOADNET.BAT
  20. -----------
  21. NET4
  22. F:
  23. STARTUP
  24.  
  25. STARTUP.BAT
  26. -----------
  27. SET BOOTUP=LOGIN
  28. MarxMenu Login
  29. %BOOTUP%
  30.  
  31. Each workstation should have their own AUTOEXEC.BAT. The last line
  32. should be LOADNET. If you are running multiple versions of dos you
  33. can have the first line of LOADNET.BAT be %NET%. You will then have
  34. to have SET NET=NET4 in your AUTOEXEC.BAT file.
  35.  
  36. Also, if you want automatic login you can add the following lines:
  37.  
  38. SET USERNAME=MARC   Your Name Here
  39. SET PASSWORD=NERD   Your Password Here
  40.  
  41. You should also change the COMSPEC= to the network command.com BEFORE
  42. you run NET4. For some unknown reason, this solves a lot of problems.
  43.  
  44. Example:
  45.  
  46. IPX
  47. SET COMSPEC=Y:COMMAMD.COM
  48. NET4
  49.  
  50. Another boot rom quirk is that you can't run any program off a boot
  51. rom that trashes upper memory. An example is running QEMM on a
  52. monochrome monitor.
  53.  
  54. By using this method the boot disk or boot rom hands control over in
  55. a clean way. LOADNET.BAT then branches to STARTUP.BAT for the rest
  56. of the login sequence.
  57.  
  58. For some strange reason which I can't explain, LOADNET and STARTUP
  59. have to be two separate batch files. I think it forces the transient
  60. part of COMMAND.COM to load into memory. Anyhow, don't combine these
  61. into one batch file
  62.  
  63. The first line of STARTUP.BAT is a message that tells this menu that
  64. the user is logging in for the first time. This menu creates a batch
  65. file and puts the name of it in the environment variable BOOTUP.
  66. STARTUP.BAT then executes this file.
  67.  
  68. This is the example for MY network. You'll have to modify it for
  69. yours.
  70.  
  71. One word of caution. After modifing this menu, always run MARXCOMP
  72. LOGIN to compile it. Otherwise, if you boot up into it you won't
  73. have enough access rights to recompile automatically.
  74.  
  75. ========================================================
  76. EndComment
  77.  
  78. var
  79.    UserName
  80.    PassW
  81.    Logged
  82.    Station
  83.    NetAddress
  84.    SmartDir
  85.    MyServer
  86.    Servers
  87.    HomeDir
  88.    DosDir
  89.    BatFile
  90.    BatName
  91.    FancyScreen
  92.    Shell
  93.  
  94. ;----- All environment string access will be the Master Environment
  95.  
  96. MasterEnvironment
  97. Shell = CleanFileName(ReadEnv('COMSPEC'))
  98.  
  99. Comment
  100. ========================================================
  101.  
  102. If Environment variables USERNAME and PASSWORD are set, this menu
  103. will attempt to log into the network using these values. This allows
  104. for automatic login. You can also pass the parameters on the command
  105. line as follows.
  106.  
  107. MarxMenu Login <Name> <Password>
  108.  
  109. The name may contain a referrence to a server: Server/Name
  110.  
  111. ========================================================
  112. EndComment
  113.  
  114. ;------ If CapsLock key is on then override default login
  115.  
  116. Logged = False
  117. if not CapsLock
  118.    UserName = ParamStr(2)
  119.    if UserName = '' then UserName = ReadEnv('USERNAME')
  120.    if UserName > ''
  121.       PassW = ParamStr(3)
  122.       if PassW = '' then PassW = ReadEnv('PASSWORD')
  123.       if PassW > ''
  124.          NovLogin (UserName,PassW)
  125.          Logged = NovResult = 0
  126.       endif
  127.    endif
  128. endif
  129.  
  130. MyServer = NovDefaultServer
  131. NovServers(Servers)
  132.  
  133. ;------ Fills station to 3 digits. Example: 004
  134.  
  135. Station  = Str(NovConnection)
  136. while length(Station) < 3
  137.    Station = '0' + Station
  138. endwhile
  139.  
  140. ;------ Read network address
  141.  
  142. NetAddress = NovStationAddress (NovConnection)
  143.  
  144. ;------ Select colors and prepare screen
  145.  
  146. if not Logged
  147.    FancyScreen = True
  148.    if ColorScreen
  149.       TextColor White Red
  150.       BoxBorderColor Green Brown
  151.       BoxInsideColor Black Brown
  152.       ClearScreen 176
  153.       ClockColor Black Brown
  154.       TextColor Black Green
  155.       BoxHeaderColor Yellow Mag
  156.       Shadow
  157.    else
  158.       TextColor Grey Black
  159.       ClearScreen 176
  160.       TextColor Black Grey
  161.       BoxBorderColor Black Grey
  162.       BoxInsideColor Black Grey
  163.       BoxHeaderColor Black Grey
  164.       ClockColor Black Grey
  165.    endif
  166.    BlankMessage = 'Netware Login'
  167.    ClockMode = 262
  168.    GotoXY 1 25
  169.    ClearLine
  170.    WriteCenter "Computer Tyme Master Network Login Menu"
  171.    SingleLineBox
  172.    Explode Off
  173.    ShadowColor Grey Red
  174.    if ColorScreen
  175.       DrawBox 3 2 74 5
  176.       ClockPos 42 5
  177.       TextColor Blue Brown
  178.    else
  179.       DrawBox 3 2 76 5
  180.       ClockPos 44 5
  181.    endif
  182.    WriteCenter 'Computer Tyme Software Development Laboratory'
  183.    Writeln
  184.    TextColor Black Brown
  185.    WriteCenter '───────────────────────────────────────────────────────'
  186.    Writeln
  187.    TextColor Black Brown
  188.    Write "  (C) 1990 by Marc Perkel"
  189.    DoubleLineBox
  190.    BlankTime = 10
  191.  
  192.    Explode On
  193.    BlockBox
  194.    BoxBorderColor Green Blue
  195.    BoxInsideColor Yellow Blue
  196.    BoxHeader = " Station Information "
  197.    if ColorScreen
  198.       DrawBox 39 17 38 6
  199.       TextColor Yellow Blue
  200.    else
  201.       DrawBox 41 17 38 6
  202.       TextColor Grey Black
  203.    endif
  204.  
  205.    Writeln '           Server: ' MyServer
  206.    Writeln '          Network: ' NetAddress
  207.    Writeln '       Connection: ' Station
  208.    Write   '      DOS Version: ' DosVersionString
  209.  
  210.    BoxHeader = ' Logging into Server * ' + MyServer + ' '
  211.    DrawBox 3 10 50 4
  212. endif
  213.  
  214. Security
  215.  
  216. while not Logged
  217.    if UserName = ''
  218.       ClearScreen
  219.       Write ' Login Name: '
  220.       UserName = UpperCase(Readln)
  221.       Writeln
  222.       if UserName = 'EXIT' then ExitMenu
  223.    endif
  224.    if not Logged
  225.       Write '   Password: '
  226.       PassW = Readln
  227.       NovLogin (UserName,PassW)
  228.       Logged = NovResult = 0
  229.    endif
  230.    if not Logged then UserName = ''
  231. endwhile
  232.  
  233. if FancyScreen
  234.    EraseTopWindow
  235.    EraseTopWindow
  236.    EraseTopWindow
  237.    EraseTopWindow
  238.    TextColor Grey Black
  239.    ClearScreen
  240. endif
  241.  
  242. UserName = NovMyLoginName
  243.  
  244. Comment
  245. ========================================================
  246.  
  247. Here we set a different directory for a program depending on if we
  248. have a color or monochrome monitor.
  249.  
  250. ========================================================
  251. EndComment
  252.  
  253. if VideoMode = Mono
  254.    SmartDir = 'F:\PUBLIC\MSMART'
  255. else
  256.    SmartDir = 'F:\PUBLIC\CSMART'
  257. endif
  258.  
  259. ;----- You can't assume that you have an F: drive unless you map it.
  260.  
  261. NovMapDrive ('F','SYS:\LOGIN')
  262.  
  263. ;----- Here we calculate a home directory for each user.
  264.  
  265. HomeDir = 'F:\HOME\' + UserName
  266. if UserName = 'SUPERVISOR' then HomeDir = 'F:\SYSTEM'
  267. if not ExistDir(HomeDir) then HomeDir = 'F:\PUBLIC\APPS'
  268.  
  269. Comment
  270. ========================================================
  271.  
  272. Here we calulate the the name of the dos directory that matches the
  273. version of dos we are running.
  274.  
  275. ========================================================
  276. EndComment
  277.  
  278. DosDir = 'F:\PUBLIC\DOSV' + DosVersionString
  279.  
  280. Comment
  281. ========================================================
  282.  
  283. Here's where we map our drives. This does not set the search path.
  284. You set that explicitly by writing to the PATH environment variable.
  285.  
  286. Drive map commands may contain server and volume referrences:
  287.  
  288. MovMapDrive('I','TYME/VOL1:SERVICE')
  289.  
  290. ========================================================
  291. EndComment
  292.  
  293. NovMapDrive ('Z',HomeDir)
  294. NovMapDrive ('Y','F:\PUBLIC\APPS')
  295. NovMapDrive ('X',DosDir)
  296. NovMapDrive ('W','F:\PUBLIC\UTIL')
  297. NovMapDrive ('P','F:\PUBLIC')
  298. NovMapDrive ('U','F:\SYSTEM')
  299. NovMapDrive ('L','F:\LOGIN')
  300. if MyServer = 'TYME'
  301.    NovMapDrive ('I','VOL1:')
  302. endif
  303. if (MyServer = 'TYME') or (MyServer = 'MARX')
  304.    NovMapDrive ('S',SmartDir)
  305. endif
  306. ;Here's where we set master environment variable strings
  307.  
  308. SetEnv ('PASSWORD=')
  309. SetEnv ('NET=')
  310. SetEnv ('USERNAME=' + UserName)
  311. SetEnv ('STATION=' + Station)
  312. if Shell <> 'C:\COMMAND.COM' then SetEnv ('COMSPEC=X:COMMAND.COM')
  313. SetEnv ('PROMPT=$e[1;33m$p: $e[0;32m')
  314. SetEnv ('PD.EXE=/$Z:PD.PIC')
  315. SetEnv ('MXCTL=/C')
  316. SetEnv ('MXECHO=OFF')
  317. if MyServer = 'MARX2'
  318.    SetEnv ('PATH=Z:.;Y:.;X:.;W:.;P:.;U:.;M:.;')
  319. else
  320.    SetEnv ('PATH=Z:.;Y:.;X:.;W:.;P:.;U:.;S:.;')
  321. endif
  322.  
  323. FixPath    ;Verifies all search paths exist
  324.  
  325. ChDir (HomeDir)
  326.  
  327. ;------ Opens a semaphore that XMETER can read.
  328.  
  329. NovOpenSemaphore ('XM-LOGIN',0)
  330.  
  331. ;------ LOGIN is set to BOOTUP if logging in for the first time
  332.  
  333. if UpperCase(ReadEnv('BOOTUP')) <> 'LOGIN' then ExitMenu
  334.  
  335. Comment
  336. ========================================================
  337.  
  338. In order to load TSRs, MarxMenu writes a temporary batch file and
  339. exits. The STARTUP.BAT file then jumps to this batch file.
  340.  
  341. ========================================================
  342. EndComment
  343.  
  344. ;------ Create temporary batch file for rest of login sequence
  345.  
  346. BatName = 'Z:$MRX' + Station + '.BAT'
  347. SetEnv ('BOOTUP=' + BATNAME)
  348. FileAssign(BatFile,BatName)
  349. FileCreate(BatFile)
  350.  
  351. if DosVersionString < '3.30'
  352.    WriteBat('ECHO OFF')
  353. else
  354.    WriteBat('@ECHO OFF')
  355. endif
  356. WriteBat ('SET BOOTUP=')
  357. WriteBat ('MARK > NUL')
  358.  
  359. ;----- Load Lan Assist
  360.  
  361. if NovInGroup ('LANASSIST')
  362.    WriteBat ('P:LA\LA +N >NUL')
  363. endif
  364.  
  365. Comment
  366. ================================================================
  367.  
  368. This next section deals with running special programs bases on the
  369. physical station number rather than by user. This deals with special
  370. hardware that needs software drivers loaded.
  371.  
  372. ================================================================
  373. EndComment
  374.  
  375. ;----- CD ROM Machine
  376.  
  377. ;if NetAddress = '255:2'
  378. ;   WriteBat ('CD\PUBLIC\MA')
  379. ;   WriteBat ('MSCDEX.EXE /D:MSCD003 /M:12')
  380. ;   WriteBat ('MAR C:\ RW=/ /C')
  381. ;endif
  382.  
  383. ;----- Vicki's Printer
  384.  
  385. if NetAddress = '255:65'
  386.    WriteBat('P:PA\PA P=1 M=200 T=10 Q1=TYME/VICKI')
  387.    Capture('VICKI',1)
  388. endif
  389.  
  390. ;----- Grace's Printer
  391.  
  392. if NetAddress = '255:68'
  393.    WriteBat('P:PA\PA P=1 M=200 T=10 Q1=TYME/GRACE')
  394.    Capture('GRACE',1)
  395. endif
  396.  
  397. ;----- Nita's Printer
  398.  
  399. if NetAddress = '255:E8'
  400.    WriteBat('P:PA\PA P=1 M=200 T=10 Q1=TYME/NITA')
  401.    Capture('NITA',1)
  402. endif
  403.  
  404. Comment
  405. ================================================================
  406.  
  407. This next section deals with running special programs bases on the
  408. users preferrences.
  409.  
  410. ================================================================
  411. EndComment
  412.  
  413. if UserName = 'MARC'
  414.    WriteBat('KBD 6 NumOff');
  415.    Capture('DOT',1)
  416.    Capture('LASER',2)
  417.    ChDir('TP6')
  418.    if MyServer = 'MARX'
  419.       SetEnv ('PATH=C:\TP6;C:\;' + ReadEnv('PATH'))
  420.       ChDir('C:\TP6')
  421.    endif
  422. endif
  423.  
  424. if UserName = 'VICKI'
  425.    Capture('LASER',2)
  426.    WriteBat('KBD 6 NumOn CR');
  427.    WriteBat('MAP ROOT C:=Z:')
  428.    WriteBat('MOUSE')
  429. endif
  430.  
  431. if UserName = 'KEVIN'
  432.    WriteBat('KBD 0,0 NumOn');
  433.    Capture('LASER',1)
  434.    Capture('DOT',2)
  435.    SetEnv('PROMPT=[$p]')
  436.    ChDir('MARX')
  437. endif
  438.  
  439. if UserName = '386'
  440.    WriteBat('KBD 6 NumOff');
  441.    Capture('DOT',1)
  442.    Capture('LASER',2)
  443. endif
  444.  
  445. if UserName = 'TBBS'
  446.    Capture('DOT',1)
  447.    Capture('LASER',2)
  448.    ChDir('I:\BBS\TBBS')
  449.    NovMapDrive('H','I:')
  450.    SetEnv('D.EXE=/O/I')
  451.    WriteBat('CASTOFF')
  452.    WriteBat('DROPTO ' + BatName + ' R')
  453. endif
  454.  
  455. if UserName = 'GRACE'
  456.    WriteBat('KBD 6 NumOn');
  457.    Capture('LASER',2)
  458. endif
  459.  
  460. if UserName = 'NITA'
  461.    WriteBat('KBD 6 NumOn CapsOn');
  462.    Capture('LASER',2)
  463. endif
  464.  
  465. if UserName = 'WORK'
  466.    WriteBat('KBD 6 NumOff');
  467.    Capture('DOT',1)
  468.    Capture('LASER',2)
  469. endif
  470.  
  471. ;----- Loads SideKick for all users in L:SIDEKICK.LST
  472.  
  473. ReadSideKickList
  474.  
  475. Comment
  476. ================================================================
  477.  
  478. The batch file ends by jumping to personal menu, if there is one, or
  479. the default menu if there isn't. DROPTO.BAT is used to erase the
  480. temporary batch file that this menu creates.
  481.  
  482. ================================================================
  483. EndComment
  484.  
  485. WriteBat ('DROPTO ' + BatName + ' MARX TYME')
  486.  
  487. FileClose(BatFile)
  488.  
  489. ExitMenu
  490.  
  491.  
  492. ;----- Procedure Definitions
  493.  
  494. Procedure WriteBat (BatLine)
  495.    FileWriteln(BatFile,BatLine)
  496. EndProc
  497.  
  498.  
  499. Procedure Pause
  500.    WriteBat ('PAUSE')
  501. EndProc
  502.  
  503.  
  504. Procedure Capture (Queue, PrinterPort)
  505. var PortSt
  506.    PortSt = Str(PrinterPort)
  507.    WriteBat ('P:CAPTURE Q=' + Queue + ' C=1 NB NFF TI=5 L=' + PortSt + '>NUL')
  508. EndProc
  509.  
  510. Comment
  511. ========================================================
  512.  
  513. A list is created in the \LOGIN directory containing the names of
  514. users who want to load sidekick. The name of the file is SIDEKICK.LST
  515. and looks like:
  516.  
  517. MARC
  518. VICKI
  519. GRACE
  520.  
  521. ========================================================
  522. EndComment
  523.  
  524. Procedure ReadSidekickList
  525. var SkList X Found
  526.    ReadTextFile ('L:SIDEKICK.LST',SkList)
  527.    X = 1
  528.    Found = False
  529.    while not Found and (X <= NumberOfElements (SkList))
  530.          if UpperCase(SkList[X]) = UserName
  531.             WriteBat('KBD CR');
  532.             WriteBat ('SWAPSK/N/G/D' + HomeDir + ' >NUL')
  533.             WriteBat ('SK')
  534.             WriteBat ('CLS')
  535.             Found = True
  536.          Endif
  537.          X = X + 1
  538.    EndWhile
  539. EndProc
  540.  
  541.